package com.goods.controller.business;
import com.goods.business.service.ProductStockServices;
import com.goods.common.model.business.Product;
import com.goods.common.model.business.ProductStock;
import com.goods.common.response.ResponseBean;
import com.goods.common.vo.business.ProductStockVO;
import com.goods.common.vo.business.ProductVO;
import com.goods.common.vo.system.PageVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;

/**
 * @author ：MJS
 * @date ：Created in 2021/6/9  21:23
 * @description：TODO
 */
@Api(tags = "业务管理-库存管理")
@RestController
@RequestMapping("/business/product/")
public class ProductStockController {
    @Autowired
    private ProductStockServices productStockServices;

    //查询物资库存
    @ApiOperation(value = "物资库存列表中的明细", notes = "查询查询物资库存")
    @GetMapping("/findProductStocks")
    public ResponseBean<PageVO<ProductStockVO>>findProductStocks(
            @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
            @RequestParam(value = "pageSize",defaultValue = "6") Integer pageSize,
            ProductVO productVO){
        PageVO<ProductStockVO>productStocksList=productStockServices.findProductStocks(pageNum,pageSize,productVO);
        return ResponseBean.success(productStocksList);
    }
    //物资所有的库存信息
    @GetMapping("/findAllStocks")
    public ResponseBean findAllStocks(ProductVO productVO){
        List<ProductStockVO>productStockVOList=productStockServices.findAllStocks(productVO);
        return ResponseBean.success(productStockVOList);
    }
}
